package com.demo;

import java.net.*;
import java.io.*;

public class news {
	
	public String getContent()
	{
		String res = "";
		try
		{
			URL url = new URL("http://www.baidu.com");
			HttpURLConnection u = (HttpURLConnection) url.openConnection();
			u.setRequestMethod("GET");
			InputStream is = u.getInputStream();
			BufferedReader b = new BufferedReader(new InputStreamReader(is));
			res = b.readLine();
		}
		catch (MalformedURLException e) {}
		catch (IOException e) {}
		return res;
	}
}
